<template>
    <div id="en">
        <button @click="fn">切换显示隐藏</button>
        <h1 v-show="flag">黑马程序员</h1>

    </div>
    
</template>

<script>
    export default {
        name: "6-vue-v-on-配置-method",
        data() {
            return {
                flag: true
            }
        },
        methods: {
            fn() {
                // this 永远表示Vue 实例对象
                this.flag = !this.flag
            }
        }
    }
</script>

<style scoped>

</style>